package com.kelp.codetoolkit.actions

import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.LangDataKeys
import com.intellij.openapi.ui.Messages
import com.intellij.psi.PsiJavaFile
import com.kelp.codetoolkit.service.CreateBusinessLogicFileService

/**
 * @author: liuyuebai
 * @date: 2024/10/11 17:27
 * @description:
 */
class ClassEntityGeneratorTemplateAction:AnAction() {
    override fun actionPerformed(e: AnActionEvent) {
        val psiFile = e.getData(LangDataKeys.PSI_FILE)?: return
        if (psiFile is PsiJavaFile){
            val project = e.project
            if (project != null) {
                CreateBusinessLogicFileService.getInstance(project).entityToBusinessLoginServiceFIle(project,psiFile)
            }
        }
    }

}